package com.panda.enums;

/**
 * @Author: panda
 * @Date: 2022-05-18 16:03
 * @Description: 自定义异常代码，待规范
 */

public enum AppHttpCodeEnum {

    SUCCESS(200, "操作成功"),
    NEED_LOGIN(401, "token过期，需要重新登陆后操作"),
    NO_AUTH(403, "无权限"),
    ERROR(101, "无权限"),
    LOGIN_ERROR(500, "登陆失败"),
    SYS_ERROR(500, "出错"),
    CAPTCHA_NOT_FOUND(400, "验证码已过期"),
    CAPTCHA_NULL(400, "验证码为空"),
    CAPTCHA_ID_NULL(400, "验证码ID值为空"),
    CAPTCHA_ERROR(400, "验证码错误"),
    USERNAME_NULL(400, "用户名为空"),
    PASSWORD_NULL(400, "密码为空"),
    USERNAME_EXIST(400, "用户名已存在"),
    ERROR_POST_ARTICLE(400, "创建文章失败"),
    ERROR_POST_VIDEO(400, "创建视频失败"),
    POST_COMMENT_ERROR(400, "评论失败"),
    DELETE_ARTICLE_ERROR(400, "删除文章失败"),
    MODIFY_ARTICLE_ERROR(400, "修改文章失败"),
    USER_NOTFOUND(400, "用户不存砸"),
    GET_ARTICLE_ERROR(400, "获取文章失败"),
    GET_VIDEO_ERROR(400, "获取视频失败"),
    VIDEO_NOT_FOUND(400, "获取视频失败"),
    DELETE_VIDEO_ERROR(400, "删除视频失败"), MODIFY_VIDEO_ERROR(400, "修改视频失败"), MODIFY_USER_ERROR(400, "更新用户失败"), ORIGIN_PWD_ERROR(400, "原密码不正确");
    int code;
    String msg;

    AppHttpCodeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
